/*
 * @Author: liangliang
 * @Date: 2023-07-25 14:11:02
 * @LastEditors: yusha
 * @LastEditTime: 2023-08-25 14:27:33
 * @Description: 路由页面配置
 */
import { ComponentType, LazyExoticComponent, lazy } from 'react';
import test from './biz/test';
import dataFactory from './dataFactory/index';
import { Button } from 'antd';

export interface RouteItem {
    /**
     * 路由页面
     * */
    component?: LazyExoticComponent<ComponentType<any>> | ComponentType<any>;
    /**
     * 路由地址
     */
    path?: string;
    /**
     * 父级路由，用于menu的高亮判断，例如 detail 页面 要定位到 列表页面 菜单上
     */
    activePath?: string;
    /**
     * 默认false，如果为true时，需要和路由相同时才能匹配，但是如果有斜杠也是可以匹配上的。
     */
    exact?: boolean;
    /**
     * 是否严格匹配斜杠结尾
     */
    strict?: boolean;
    /**
     * 页面标题
     */
    title?: string;
    /**
     * 显示左侧菜单，默认为true
     */
    showMenu?: boolean;
    /**
     * 显示头部，默认为true，如果设为false，则无头部组件
     */
    showHeader?: boolean;
    showLayout?: boolean;
    /** 页面权限code */
    pagePermissionCode?: string;
    /** 操作权限code */
    actionPermissionCode?: string[];
}
/** 基础路由 */
export const ROUTER_BASENAME = '';
const routerList: RouteItem[] = [
    ...dataFactory,
    ...test,
    // {
    //     path: '/summary',
    //     title: '首页',
    //     component: lazy(() => import('../../container/summary')),
    // },
    {
        path: '/*',
        title: '彩虹桥',
        component: function () {
            // eslint-disable-next-line react/react-in-jsx-scope
            return (
                <div
                    style={{
                        width: '100%',
                        height: '1180px',
                        border: 'none',
                        position: 'relative',
                        left: 0,
                        top: 0,
                    }}
                >
                    <iframe
                        style={{
                            width: '100%',
                            height: '100%',
                            border: 'none',
                        }}
                        src="http://192.168.201.161:8080"
                    ></iframe>
                </div>
            );
        },
    },
    {
        path: '/manager/list',
        title: '故障列表',
        component: lazy(() => import('../../container/manager/TestList')),
    },
    {
        path: '/manager/demand',
        title: '需求登记',
        component: lazy(() => import('../../container/manager/demand')),
    },
    {
        path: '/manager/publishPlan',
        title: '发布计划',
        component: lazy(() => import('../../container/manager/publishPlan')),
    },
    {
        path: '/manager/mobilePhone',
        title: '测试机管理',
        component: lazy(() => import('../../container/manager/mobilePhone')),
    },
    {
        path: '/manager/platformAddress',
        title: '平台地址',
        component: lazy(
            () => import('../../container/manager/platformAddress')
        ),
    },
    {
        path: '/opsManager/login',
        title: 'ops用户登录',
        component: lazy(() => import('../../container/opsManager/login')),
    },
    {
        path: '/opsManager/home',
        title: 'ops主页',
        component: lazy(() => import('../../container/opsManager/home')),
    },
    {
        path: '/opsManager/opsMember',
        title: '赠送会员',
        component: lazy(() => import('../../container/opsManager/opsMember')),
    },
    {
        path: '/opsManager/opsCustomer',
        title: '客户管理',
        component: lazy(() => import('../../container/opsManager/opsCustomer')),
    },
    {
        path: '/opsManager/opsDeliveryTask',
        title: '发货单信息查询',
        component: lazy(
            () => import('../../container/opsManager/opsDeliveryTask')
        ),
    },
    {
        path: '/opsManager/opsMaterial',
        title: '材质信息更新',
        component: lazy(() => import('../../container/opsManager/opsMaterial')),
    },
    {
        path: '/opsManager/opsProductInfo',
        title: '更新商品信息',
        component: lazy(
            () => import('../../container/opsManager/opsProductInfo')
        ),
    },
    {
        path: '/opsManager/opsPurchaseInfo',
        title: '采购单明细',
        component: lazy(
            () => import('../../container/opsManager/opsPurchaseInfo')
        ),
    },
    {
        path: '/opsManager/opsPurchaseRelation',
        title: '采购单-订单-异常采购单关联关系',
        component: lazy(
            () => import('../../container/opsManager/opsPurchaseRelation')
        ),
    },
    {
        path: '/opsManager/opsSearchCustomer',
        title: '客户基本信息查询',
        component: lazy(
            () => import('../../container/opsManager/opsSearchCustomer')
        ),
    },
    {
        path: '/opsManager/opsSearchOrder',
        title: '平台订单信息查询',
        component: lazy(
            () => import('../../container/opsManager/opsSearchOrder')
        ),
    },
    {
        path: '/opsManager/opsSettlementPurchase',
        title: '异采购单和流水',
        component: lazy(
            () => import('../../container/opsManager/opsSettlementPurchase')
        ),
    },
    {
        path: '/opsManager/opsWms',
        title: '库存调整',
        component: lazy(
            () => import('../../container/opsManager/opsWms')
        ),
    },
];

export default routerList;
